package com.dq.controller.finance;

import com.dq.controller.in.AccountQuery;
import com.dq.domain.sys.user.Account;
import com.dq.exception.customException.AdminException;
import com.dq.service.AllService;
import com.dq.service.account.AccountService;
import com.dq.vo.ListVo;
import com.dq.vo.baseVo.VO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created by DongChenLong On 2020/5/7 15:03.
 */
@Api("后台充值记录管理")
@RestController
@RequestMapping("sys/account")
public class AccountController extends AllService {

    @Autowired
    AccountService accountService;

    @RequestMapping("/list")
    public ListVo<Account.Vo> list(@RequestBody AccountQuery accountQuery) throws AdminException {
        List<Account> accounts=accountService.list(accountQuery);
        Long count=accountService.accountCount(accountQuery);
        return new ListVo((List<Account.Vo>) VO.toVOCollection(accounts),count);
    }

}
